home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
3_12.lha
/
3_12
/
3_12tst.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
657b
|
33 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <stream.h>
include <string.h>
include <ctype.h>
num token_value {
END = 'E', PRINT='P', NUMBER='#', NAME='N',
L1='*', L2='+', L3='(', L4=')', L5='/', L6='-', L7=':'
curr_tok;
ouble number_value;
har name_string[512];
include "3_12.c"
ain()
while (get_token() != END)
{
cout << "curr_tok=" << chr(curr_tok) << "\n";
switch (curr_tok)
{
case NAME: cout << "name='" << name_string << "'\n"; break;
case NUMBER:cout << "numb='" << number_value<< "'\n"; break;
}
}
return 0;